package top.mcwebsite.playandroid.business.qa.model

import android.os.Parcelable
import kotlinx.parcelize.Parcelize
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable


@Serializable
@Parcelize
data class QAReplayComment(
    @SerialName("anonymous")
    val anonymous: Int,
    @SerialName("appendForContent")
    val appendForContent: Int,
    @SerialName("articleId")
    val articleId: Int,
    @SerialName("canEdit")
    val canEdit: Boolean,
    @SerialName("content")
    val content: String,
    @SerialName("contentMd")
    val contentMd: String,
    @SerialName("id")
    val id: Int,
    @SerialName("niceDate")
    val niceDate: String,
    @SerialName("publishDate")
    val publishDate: Long,
    @SerialName("replyCommentId")
    val replyCommentId: Int,
    @SerialName("replyComments")
    val replyComments: List<QAReplayComment>,
    @SerialName("rootCommentId")
    val rootCommentId: Int,
    @SerialName("status")
    val status: Int,
    @SerialName("toUserId")
    val toUserId: Int,
    @SerialName("toUserName")
    val toUserName: String,
    @SerialName("userId")
    val userId: Int,
    @SerialName("userName")
    val userName: String,
    @SerialName("zan")
    val zan: Int
) : Parcelable {
    fun getDisplayUsername() = if (anonymous == 1) {
        "匿名用户"
    } else {
        userName
    }
}